import { getToken } from '@/utils/auth'
import request from '@/utils/request'

// 良率情况
export function getTpcnEntYield(data) {
    return request({
        url: '/tpcnEn/yield',
        method: 'post',
        data,
        timeout: 300000, // 服务端接口时间本来就比较长，需要前端把超时时间单独延长到5分钟
    })
}

// 保存查询结果
export function historySave(data) {
    return request({
        url: '/tpcnEn/history/save',
        method: 'post',
        data,
    })
}

// 历史记录
export function historyPage(data) {
    return request({
        url: '/tpcnEn/history/page',
        method: 'post',
        data,
    })
}

// 历史记录删除
export function historyDelete(id) {
    return request({
        url: `/tpcnEn/history/${id}`,
        method: 'delete',
    })
}

// 历史记录详情
export function historyDetail(id) {
    return request({
        url: `/tpcnEn/history/${id}`,
        method: 'get',
    })
}

// WIP分析-WIP
export function queryWip(data) {
    return request({
        url: '/tpcnEn/wip',
        method: 'post',
        data,
    })
}

// WIP分析-明细
export function wipDetail(data) {
    return request({
        url: '/tpcnEn/wipDetail',
        method: 'post',
        data,
    })
}
export function getSearchTime(data) {
    return request({
        url: '/tpcnEn/getSearchTime',
        method: 'post',
        data
    })
}
